package com.wetsion.securityoauthdemo.rmsclient.handler;

import com.wetsion.securityoauthdemo.rmsclient.common.ClientDetails;
import com.wetsion.securityoauthdemo.rmsclient.common.RmsClientDetailsProperties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 默认的获取客户端信息的实现
 *
 * @author weixin
 * @version 1.0
 * @CLassName DefaultClientDetailsGetter
 * @date 2019/3/13 11:05 AM
 */
public class DefaultClientDetailsGetter implements ClientDetailsGetter {

    public DefaultClientDetailsGetter() {}

    @Override
    public ClientDetails handle(HttpServletRequest request, HttpServletResponse response, RmsClientDetailsProperties properties) throws Exception {
        ClientDetails details = new ClientDetails();
        details.setClientId(properties.getClientId());
        details.setClientSecret(properties.getClientSecret());
        return details;
    }
}
